﻿(function() {
    var carouselFactory = function($http, $q) {
        var factory = {};

        //factory.getCatorgories = function() {

        //};

        factory.getImageInfo = function(category) {
            var defered = $q.defer();
            $http.get('/api/ImageInfo/' + category)
                .success(defered.resolve)
                .error(defered.reject);
            return defered.promise;
        };

        factory.getCategories = function () {
            var defered = $q.defer();
            $http.get('/api/Category')
                .success(defered.resolve)
                .error(defered.reject);
            return defered.promise;
        };

        return factory;
    };

    carouselFactory.$inject = ['$http', '$q'];
    angular.module('app').factory('carouselFactory', carouselFactory);
}());